package com.realtyManage.springboot.Service.impl;

import com.realtyManage.springboot.Dao.ContactRepository;
import com.realtyManage.springboot.Model.Do.Contact;
import com.realtyManage.springboot.Service.IContactService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

/**
 * 联系我们
 *
 * @Author 杭州素色网络科技有限公司
 * @Date 2019/07/28
 **/
@Service
@Transactional
public class ContactServiceImpl implements IContactService {
    @Autowired
    private ContactRepository contactRepository;

    @Override
    public Contact insert(Contact entity) {
        return contactRepository.saveAndFlush(entity);
    }

    @Override
    public List<Contact> getHouseContactList() {
        return contactRepository.findAll();
    }

}
